;$.fn.popup=function(option){
	var defaults={
		
	}
	
	var options=$.extend({}, defaults, option);
	var $this=this;
	var $div=$("<div class='popup'></div>")
	$div.css({
		width:$(window).width(),
		height:$(window).height(),
		background:"rgba(0,0,0,.5)",
		position:'fixed',
		top:0,
		left:0,
		zIndex:99999,
		display:'none',
		paddingTop:($(window).height()-$this.height())/2
	})
	
	$this.height($this.height())
	
	this.each(function(){
		$div.click(function(){
				$(this).hide()
			}).append($this.show()).appendTo($('body')).show();
		if($(".popup").length>1){
			$(".popup").eq(0).remove()
		}
	})
	
	$this.click(function(e){
		e.stopPropagation()
	})
	
	return this;
	
}

